package ma.main;

import java.io.FileNotFoundException;
import java.io.IOException;

import ma.mediascanner.MediaScanner;
import ma.utils.HibernateUtils;

/**
 * project:mediaarchive
 * 
 * @author Maik Lempik 2011
 */
public class Main {


	public void run() {

		try {
			long d = System.currentTimeMillis();
			MediaScanner ms = new MediaScanner();

			ms.scan(0,1);
//			ms.scan(1,1);
			
			d = System.currentTimeMillis() - d;
			
			System.out.println("Dauer: "+ d + " msek." );
			
			HibernateUtils.getSessionFactory().getCurrentSession().getTransaction().commit();
			HibernateUtils.getSessionFactory().close();
			
		} catch (FileNotFoundException e1) {
			e1.printStackTrace();
		} catch (IOException e1) {
			e1.printStackTrace();
		} catch (IndexOutOfBoundsException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		
	}

}
